<?php 
include "conn.php";

if(isset($_POST['tel'])){
    $tel=$_POST['tel'];
    $result=$conn->query("SELECT * FROM registry WHERE tel ='$tel'" );
    if($result->fetch_assoc()){
        echo '1';
    }else{
        echo '0';
    }
}
if (isset($_POST['submit'])){
   $tel= $_POST['tel'];
   $password= $_POST['password'];
   $password2= $_POST['password2'];

   $conn->query("insert registry values(null,'$tel','$password','$password2')");
   header('location:http://10.31.165.32/com.111.www/src/login.html');
   
}
?>

